﻿namespace StyleCop.CSharp
{
    using System.Collections.Generic;

    public class ViolationInfoEqualityComparer : IEqualityComparer<ViolationInfo>
    {
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="ViolationInfoEqualityComparer"/> class.
        /// </summary>
        public ViolationInfoEqualityComparer()
        {
        }
        #endregion Constructors

        #region IEqualityComparer<ViolationInfo> Members
        public bool Equals(ViolationInfo x, ViolationInfo y)
        {
            return (x.LineNumber == y.LineNumber)
                && (x.Message == y.Message);
        }

        public int GetHashCode(ViolationInfo obj)
        {
            return obj.GetHashCode();
        }
        #endregion
    }
}